- Notifications
You must be signed in to change notification settings - Fork 5.8k
/
Copy path752. Open the Lock_test.go
53 lines (42 loc) · 878 Bytes
/
752. Open the Lock_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package leetcode
import (
"fmt"
"testing"
)
typequestion752struct {
para752
ans752
}
// para 是参数
// one 代表第一个参数
typepara752struct {
deadends []string
targetstring
}
// ans 是答案
// one 代表第一个答案
typeans752struct {
oneint
}
funcTest_Problem752(t*testing.T) {
qs:= []question752{
{
para752{[]string{"0201", "0101", "0102", "1212", "2002"}, "0202"},
ans752{6},
},
{
para752{[]string{"8888"}, "0009"},
ans752{1},
},
{
para752{[]string{"8887", "8889", "8878", "8898", "8788", "8988", "7888", "9888"}, "8888"},
ans752{-1},
},
}
fmt.Printf("------------------------Leetcode Problem 752------------------------\n")
for_, q:=rangeqs {
_, p:=q.ans752, q.para752
fmt.Printf("【input】:%v 【output】:%v\n", p, openLock(p.deadends, p.target))
}
fmt.Printf("\n\n\n")
}